<div id="root">
  <textarea name="" v-model="content" id="" cols="30" rows="10"></textarea>
  <p :style="{color:warn?'red':''}">{{content.length}} / 100</p>
  <button :disabled="content.length<=0 || content.length>=100">发布</button>
  <button :disabled="content.length<0" @click="content=''">清空</button>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.min.js"></script>
<script src="https://cdn.bootcss.com/Mock.js/1.0.0/mock-min.js"></script>
<script>
  new Vue({
    el: "#root",
    data: {
      content: "",
    },
    computed: {
      warn() {
        return this.content.length > 100 ? true : false;
      },
    },
  });
</script>
